/*****************************************************************************
*
*  PROJECT:		
*               
*  LICENSE:		
*
*  DEVELOPER:	
*
*****************************************************************************/

#ifndef EONVECTOR3_H
#define EONVECTOR3_H

#include <cmath>

namespace Eon
{
class Vector3
	{
	private:
		float x, y, z;

	public:
		//////////////////////////////////////////////////////////
		//					Constructors						//
		//////////////////////////////////////////////////////////

		Eon::Vector3() : x(0), y(0), z(0) { }
		Eon::Vector3( float a, float b, float c ) : x(a), y(b), z(c) { }

		//////////////////////////////////////////////////////////
		//					Accessor Methods					//
		//////////////////////////////////////////////////////////

		const float& getX () const				{ return x; }
		void  setX ( float fX )					{ x = fX; }

		const float& getY () const				{ return y; }
		void  setY ( float fY )					{ x = fY; }

		const float& getZ () const				{ return z; }
		void  setZ ( float fZ )					{ x = fZ; }

		//////////////////////////////////////////////////////////
		//				Operator overloads						//
		//////////////////////////////////////////////////////////

		// comparison
		bool operator== ( Eon::Vector3& vec );

		// negation
		Eon::Vector3 operator- ();

		// assignment
		const Eon::Vector3& operator= ( const Eon::Vector3& vec );

		// addition
		const Eon::Vector3& operator+= ( const Eon::Vector3& vec );
	
		// subtraction
		const Eon::Vector3& operator-= ( const Eon::Vector3& vec );

		// scaling up
		const Eon::Vector3& operator*= ( const float& fScale );

		// scaling down
		const Eon::Vector3& operator/= ( const float& fScale );

		// addition w/o modification
		const Eon::Vector3 operator+ ( const Eon::Vector3& vec ) const;

		// subtraction w/o modification
		const Eon::Vector3 operator- ( const Eon::Vector3& vec ) const;

		// scaling up w/o modification
		const Eon::Vector3 operator* ( const float& fScale ) const;

		// scaling down w/o modification
		const Eon::Vector3 operator/ ( const float& fScale ) const;

	
		//////////////////////////////////////////////////////////
		//					Class Functions						//
		//////////////////////////////////////////////////////////
	
		// dot product
		const float dot ( const Eon::Vector3& vec ) const;

		// vector length
		const float length() const;

		// unit vector
		const Eon::Vector3 unit() const;

		// normalize - make this vector a unit vector
		void normalize ( void );

		// update this vector
		void update ( const Eon::Vector3& vec );
		void update ( float fX, float fY, float fZ);
	};
}
#endif // EONVECTOR3_H